<!--
/**
* @name MonitorMap
* @description 监控地图
* @author wind-lc
* @date 2020-06-10
* @param {Array} lable 地图标注
* @example <monitor-map :search="search"></monitor-map>
*/
-->
<template>
  <div class="data-monitor-map-container">
    <div ref="dataMonitorMap"
         class="data-monitor-map">
    </div>
    <div v-show="mapLoading"
         class="data-monitor-map-loading">
      <a-spin size="large"
              tip="
              地图正在加载..." />
    </div>
  </div>
</template>
<script>
import { Spin } from 'ant-design-vue'
import BMapGL from 'BMapGL'
export default {
  name: 'MonitorMap',
  components: {
    ASpin: Spin
  },
  props: {
    search: {
      type: Object,
      required: true
    }
  },
  data () {
    return {
      // 地图实例
      map: null,
      // 地图loading
      mapLoading: true,
      // 行政区覆盖物
      districtOverlay: [],
      // 自动触发地图缩放
      noZoomend: false,
      // 企业点数据
      labelData: []
    }
  },
  watch: {
    search: {
      handler (newV, oldV) {
        if (newV.value === '' && newV.type === '0') {
          this.getData()
        }
        const data = [
          {
            id: '111',
            name: '成都市新都金海污水处理有限责任公司',
            lng: 104.189311,
            lat: 30.805882,
            isDistrict: false
          },
          {
            id: '222',
            name: '四川兴经纬测绘有限公司',
            lng: 104.004798,
            lat: 30.503296,
            isDistrict: false
          }
        ]
        this.mapLoading = true
        setTimeout(() => {
          const arr = data.map((el, i) => {
            if (el.name.indexOf(newV.value) > -1) {
              return el
            }
          }).filter(el => el)
          console.log(arr)
          this.districtClusterer(arr)
          this.mapLoading = false
        }, 300)
      },
      deep: true
    }
  },
  mounted () {
    this.init()
  },
  methods: {
    // 初始化
    async init () {
      this.mapLoading = true
      await this.initMap()
      this.getData()
    },
    // 地图初始化
    initMap () {
      return new Promise((resolve, reject) => {
        // 实例化地图,禁用底点击
        this.map = new BMapGL.Map(this.$refs.dataMonitorMap, { enableMapClick: false, minZoom: 11, maxZoom: 21 })
        // 初始化地图,设置中心点坐标和地图级别
        this.map.centerAndZoom(new BMapGL.Point(104.072251, 30.664694), 12)
        // 开启鼠标滚轮缩放
        this.map.enableScrollWheelZoom(true)
        // 禁用地图惯性拖拽
        this.map.disableInertialDragging()
        // 添加3D控件
        this.map.addControl(new BMapGL.NavigationControl3D())
        // 地图加载完成
        this.map.addEventListener('tilesloaded', () => {
          resolve()
        })
        // 监听地图缩放级别
        this.map.addEventListener('zoomend', () => {
          // if (this.labelData.length > 0) {
          //   this.addViewLabel(this.labelData)
          // }
          if (this.noZoomend) { // 自动触发
            this.noZoomend = false
          } else { // 用户触发
            if (this.map.getZoom() < 14) {
              this.getData()
            } else {
              this.getData('all')
            }
          }
        })
      })
    },
    // 获取地图数据
    getData (area = '') {
      let data = []
      setTimeout(() => {
        switch (area) {
          case 'all':
            data = [
              {
                id: '111',
                name: '成都市新都金海污水处理有限责任公司',
                lng: 104.189311,
                lat: 30.805882,
                count: 4,
                alarm: true,
                isDistrict: false
              },
              {
                id: '222',
                name: '四川兴经纬测绘有限公司',
                lng: 104.004798,
                lat: 30.503296,
                count: 4,
                alarm: true,
                isDistrict: false
              }
            ]
            break
          case '':
            data = [
              {
                id: '1',
                name: '武侯区',
                lng: 104.049688,
                lat: 30.648209,
                count: 0,
                boundaries: [
                  '104.100824, 30.635889;104.09852, 30.641909;104.095428, 30.646009;104.091278, 30.647821;104.086871, 30.650218;104.081191, 30.651639;104.073008, 30.652617;104.06724, 30.653159;104.062698, 30.655222;104.05766, 30.657956;104.054193, 30.65751;104.04647, 30.657898;104.03768, 30.657056;104.031092, 30.657465;104.027413, 30.659697;104.025133, 30.663483;104.020756, 30.660993;104.014351, 30.658755;104.01203, 30.661867;104.011941, 30.665454;104.008035, 30.666302;104.003421, 30.66334;104.001156, 30.659883;104.000498, 30.662616;103.99965, 30.664366;103.997606, 30.666604;103.996906, 30.664225;103.99556, 30.663939;103.994071, 30.666305;103.992213, 30.666815;103.990853, 30.664838;103.989428, 30.663347;103.986945, 30.662378;103.987848, 30.664771;103.985035, 30.667856;103.98312, 30.666296;103.977777, 30.662699;103.976034, 30.660546;103.973714, 30.661006;103.974057, 30.664429;103.975851, 30.665669;103.977196, 30.667526;103.973703, 30.667948;103.972053, 30.667692;103.96754, 30.670286;103.967144, 30.669021;103.967615, 30.666643;103.961955, 30.664824;103.959287, 30.663941;103.957027, 30.663749;103.95659, 30.661337;103.958029, 30.659275;103.955643, 30.655697;103.954294, 30.653626;103.955283, 30.650614;103.957733, 30.651189;103.958965, 30.650225;103.959126, 30.646708;103.957788, 30.644016;103.959888, 30.643082;103.960277, 30.640229;103.959674, 30.638669;103.962801, 30.636559;103.963469, 30.634295;103.966211, 30.632258;103.968257, 30.630184;103.966277, 30.62853;103.964837, 30.626926;103.962277, 30.625628;103.962487, 30.62358;103.962876, 30.621458;103.962703, 30.616699;103.964279, 30.613356;103.968505, 30.613578;103.969814, 30.611286;103.970871, 30.611251;103.97245, 30.612922;103.97329, 30.61178;103.973165, 30.608056;103.971923, 30.600579;103.972939, 30.597212;103.973041, 30.594245;103.971772, 30.592045;103.971381, 30.58831;103.972475, 30.586782;103.971898, 30.584822;103.97357, 30.583724;103.974881, 30.583221;103.973145, 30.581718;103.973039, 30.579973;103.977151, 30.577776;103.981335, 30.577643;103.983234, 30.578535;103.982607, 30.582026;103.989239, 30.585293;103.992894, 30.59035;104.004301, 30.589055;104.006152, 30.585497;104.008545, 30.584164;104.011288, 30.582957;104.011803, 30.583849;104.01216, 30.584659;104.012718, 30.585971;104.013547, 30.586954;104.01485, 30.588151;104.015744, 30.589766;104.014443, 30.592382;104.02074, 30.589075;104.026425, 30.586905;104.033272, 30.584163;104.040214, 30.577115;104.043449, 30.575518;104.041592, 30.56976;104.035937, 30.569139;104.032284, 30.563074;104.030972, 30.553008;104.040895, 30.546781;104.044606, 30.54652;104.042957, 30.542648;104.043904, 30.538076;104.043897, 30.533097;104.049893, 30.534975;104.049836, 30.536906;104.047817, 30.538256;104.049633, 30.540555;104.051174, 30.542776;104.050733, 30.544106;104.049553, 30.546531;104.049374, 30.548068;104.05554, 30.547696;104.060036, 30.542606;104.062277, 30.543191;104.068546, 30.537443;104.070313, 30.536105;104.07602, 30.538981;104.079824, 30.542402;104.085535, 30.542786;104.087489, 30.545542;104.083474, 30.54736;104.081412, 30.552652;104.082863, 30.556183;104.08905, 30.557402;104.09015, 30.563099;104.086435, 30.566465;104.089278, 30.57277;104.087168, 30.575795;104.081984, 30.575643;104.08002, 30.577861;104.08242, 30.581335;104.086414, 30.586236;104.085259, 30.589734;104.084796, 30.59259;104.08656, 30.595937;104.090001, 30.597069;104.088996, 30.600503;104.087933, 30.605146;104.089276, 30.607209;104.092501, 30.607959;104.094134, 30.609755;104.094846, 30.61307;104.094323, 30.614937;104.093299, 30.618758;104.091071, 30.62172;104.092256, 30.624011;104.091469, 30.626694;104.091402, 30.630122;104.094449, 30.632377;104.099799, 30.632901'
                ],
                isDistrict: true
              },
              {
                id: '2',
                name: '金牛区',
                lng: 104.058765,
                lat: 30.69756,
                count: 0,
                boundaries: [
                  '104.14685, 30.766085;104.14415, 30.769067;104.135235, 30.768123;104.128599, 30.768593;104.125716, 30.774495;104.126991, 30.776693;104.130664, 30.777883;104.131676, 30.780341;104.133758, 30.782201;104.133861, 30.785483;104.131011, 30.787784;104.124669, 30.793449;104.117626, 30.79456;104.109482, 30.794968;104.108763, 30.797809;104.105519, 30.801499;104.098307, 30.799129;104.097548, 30.801581;104.100488, 30.80394;104.09986, 30.806824;104.097339, 30.807272;104.094545, 30.803954;104.092869, 30.805471;104.096156, 30.808558;104.094624, 30.811717;104.091754, 30.812819;104.089827, 30.81003;104.087862, 30.810681;104.079741, 30.811822;104.074655, 30.807803;104.067954, 30.808251;104.068883, 30.804392;104.067209, 30.797872;104.06741, 30.794135;104.061595, 30.793176;104.063173, 30.793207;104.064489, 30.792591;104.064701, 30.791128;104.064404, 30.790187;104.063534, 30.790109;104.063915, 30.789262;104.064494, 30.788911;104.064789, 30.788149;104.065339, 30.788596;104.06501, 30.789174;104.065767, 30.78986;104.066856, 30.789258;104.067587, 30.78869;104.068319, 30.788485;104.068186, 30.788003;104.068054, 30.787472;104.069053, 30.787438;104.069928, 30.788081;104.070686, 30.788209;104.070663, 30.787454;104.070654, 30.786771;104.070132, 30.786091;104.070844, 30.785135;104.072002, 30.785178;104.072785, 30.785528;104.0738, 30.786091;104.074169, 30.787011;104.075325, 30.787232;104.077572, 30.786262;104.078635, 30.785073;104.079146, 30.783878;104.07824, 30.780674;104.077136, 30.773595;104.07877, 30.770867;104.076945, 30.771068;104.075784, 30.770375;104.076603, 30.768859;104.079349, 30.767449;104.080959, 30.769737;104.081823, 30.768627;104.082226, 30.76741;104.084153, 30.767547;104.086432, 30.767602;104.087552, 30.770633;104.091044, 30.771253;104.093885, 30.772617;104.095851, 30.772885;104.095974, 30.771388;104.098488, 30.771111;104.102052, 30.771738;104.103263, 30.771529;104.101983, 30.769484;104.101216, 30.767951;104.102966, 30.76654;104.102376, 30.762652;104.097097, 30.758936;104.085863, 30.755588;104.081273, 30.748883;104.076638, 30.744147;104.071056, 30.745562;104.066585, 30.748346;104.062167, 30.75352;104.05506, 30.757161;104.049535, 30.757977;104.046445, 30.752143;104.043484, 30.74926;104.040128, 30.751041;104.038391, 30.748364;104.043681, 30.743646;104.042183, 30.740656;104.039916, 30.739441;104.04259, 30.736566;104.037809, 30.738692;104.034172, 30.740797;104.032054, 30.74414;104.033846, 30.744654;104.03414, 30.745697;104.030325, 30.747801;104.027511, 30.747383;104.027857, 30.749471;104.027585, 30.751761;104.027841, 30.75402;104.026212, 30.754871;104.022313, 30.753396;104.01913, 30.75512;104.020061, 30.756731;104.02218, 30.758059;104.023393, 30.760001;104.021155, 30.762071;104.020345, 30.764473;104.016377, 30.763108;104.008897, 30.763996;104.006747, 30.762047;104.00267, 30.76072;104.004236, 30.759581;104.004213, 30.755952;104.00426, 30.750165;104.010599, 30.745159;104.00543, 30.741932;104.004233, 30.738082;104.000944, 30.734155;104.000075, 30.729979;103.998176, 30.732014;103.995926, 30.730965;103.993717, 30.733461;103.991543, 30.736531;103.989712, 30.737693;103.986679, 30.735605;103.983668, 30.736166;103.98162, 30.733882;103.981014, 30.731842;103.984783, 30.728264;103.986421, 30.726187;103.982084, 30.723444;103.981279, 30.723709;103.979721, 30.724578;103.979642, 30.728062;103.97837, 30.72527;103.977494, 30.725206;103.974241, 30.727334;103.972773, 30.728602;103.973132, 30.729366;103.974182, 30.729651;103.973553, 30.730952;103.97355, 30.731787;103.973612, 30.732607;103.973003, 30.733069;103.971858, 30.732649;103.968722, 30.731305;103.968781, 30.728047;103.965873, 30.728354;103.961187, 30.726207;103.960243, 30.723282;103.962096, 30.722026;103.964179, 30.722992;103.966816, 30.722102;103.967061, 30.719499;103.969224, 30.717211;103.97148, 30.717816;103.973971, 30.717264;103.977238, 30.716698;103.977725, 30.714872;103.977647, 30.712762;103.978198, 30.71082;103.979887, 30.711103;103.980533, 30.708311;103.979603, 30.706117;103.980627, 30.704604;103.982425, 30.702927;103.984545, 30.70166;103.986752, 30.699575;103.989362, 30.697489;103.98989, 30.699241;103.993517, 30.700872;103.996578, 30.699813;103.99785, 30.700816;103.99773, 30.702008;103.996897, 30.70196;103.996214, 30.702054;103.995673, 30.703076;103.995839, 30.703752;103.996385, 30.704537;103.996384, 30.705681;103.995909, 30.70621;103.994716, 30.706196;103.993519, 30.706179;103.992872, 30.706766;103.993444, 30.70753;103.993836, 30.708178;103.994537, 30.708562;103.995376, 30.708806;103.996035, 30.709037;103.996058, 30.709619;103.995538, 30.709973;103.994937, 30.710272;103.995485, 30.711761;103.998805, 30.710132;104.003505, 30.708867;104.005958, 30.709699;104.007732, 30.706721;104.007653, 30.703509;104.009882, 30.702818;104.012704, 30.704515;104.015401, 30.705499;104.014411, 30.703646;104.015457, 30.700028;104.018038, 30.698754;104.016554, 30.695963;104.014394, 30.694963;104.010107, 30.694819;104.009968, 30.692851;104.008703, 30.690748;104.009198, 30.689778;104.01106, 30.691337;104.012703, 30.691731;104.012969, 30.689998;104.013879, 30.690376;104.014494, 30.692153;104.015907, 30.692032;104.016981, 30.691485;104.017749, 30.689745;104.018906, 30.689435;104.020415, 30.688079;104.021462, 30.687957;104.022166, 30.688798;104.023174, 30.687071;104.024557, 30.688683;104.025957, 30.68948;104.02807, 30.689117;104.031115, 30.688672;104.032417, 30.687385;104.033523, 30.687645;104.03388, 30.687828;104.034899, 30.687556;104.036334, 30.686334;104.037133, 30.685917;104.039035, 30.685761;104.03901, 30.684895;104.037848, 30.68371;104.037397, 30.680571;104.038949, 30.680147;104.037526, 30.678309;104.039021, 30.677726;104.040141, 30.676296;104.04091, 30.675355;104.041843, 30.67513;104.043408, 30.675151;104.044423, 30.674088;104.045, 30.673763;104.046198, 30.673286;104.052882, 30.66965;104.054327, 30.67133;104.055781, 30.672584;104.057402, 30.674322;104.057367, 30.675057;104.057389, 30.676445;104.057298, 30.676972;104.05757, 30.677522;104.058059, 30.678842;104.058437, 30.679459;104.058844, 30.68028;104.058978, 30.681328;104.059807, 30.68209;104.061254, 30.682447;104.062557, 30.683437;104.064014, 30.684433;104.065445, 30.684464;104.067187, 30.684255;104.068002, 30.684522;104.068954, 30.68737;104.069604, 30.688546;104.076543, 30.684946;104.080703, 30.684003;104.083476, 30.682249;104.087427, 30.680338;104.08969, 30.678986;104.091162, 30.67877;104.092459, 30.678499;104.093477, 30.677647;104.094698, 30.676628;104.09608, 30.675963;104.101394, 30.682489;104.096385, 30.687028;104.098667, 30.69326;104.097972, 30.696507;104.099841, 30.697788;104.100373, 30.69994;104.098173, 30.702402;104.089099, 30.703258;104.084382, 30.703826;104.078945, 30.704244;104.077997, 30.709361;104.076611, 30.71288;104.077877, 30.714782;104.077239, 30.720101;104.077459, 30.72432;104.07815, 30.72457;104.07844, 30.724486;104.078471, 30.724019;104.078806, 30.723873;104.07908, 30.723396;104.080063, 30.722986;104.080045, 30.72227;104.078608, 30.719983;104.080953, 30.71876;104.083617, 30.721981;104.088047, 30.723036;104.089058, 30.721104;104.092239, 30.719761;104.095831, 30.720505;104.094867, 30.724247;104.095956, 30.726894;104.098767, 30.728366;104.101039, 30.728561;104.104472, 30.729148;104.108507, 30.729265;104.10907, 30.732594;104.108597, 30.738103;104.110844, 30.737849;104.113521, 30.735064;104.11647, 30.736628;104.120527, 30.738318;104.122781, 30.737675;104.122897, 30.740381;104.125234, 30.743804;104.124201, 30.746881;104.127921, 30.745289;104.131269, 30.746299;104.131449, 30.748547;104.135056, 30.748169;104.132543, 30.750853;104.132245, 30.75459;104.135703, 30.754364;104.138414, 30.753042;104.140125, 30.755719;104.142331, 30.752169;104.143918, 30.74993;104.146293, 30.753769;104.145136, 30.762175',
                  '103.970416, 30.787906;103.966629, 30.789316;103.961208, 30.790539;103.956954, 30.787395;103.957175, 30.784164;103.957731, 30.783044;103.957137, 30.782762;103.955695, 30.782949;103.953365, 30.78428;103.951308, 30.781365;103.952166, 30.780679;103.953305, 30.780296;103.953941, 30.780267;103.95417, 30.779816;103.954663, 30.779296;103.955194, 30.777974;103.955107, 30.775288;103.958976, 30.774914;103.962591, 30.778011;103.966683, 30.780297;103.966698, 30.781748;103.96969, 30.784575;103.970331, 30.787246'
                ],
                isDistrict: true
              },
              {
                id: '3',
                name: '成华区',
                lng: 104.107934,
                lat: 30.665933,
                count: 0,
                boundaries: [
                  '104.24373, 30.693199;104.23958, 30.696631;104.236707, 30.696899;104.235759, 30.699142;104.232945, 30.70031;104.235382, 30.703165;104.23467, 30.70786;104.232076, 30.707465;104.228911, 30.713181;104.23162, 30.714199;104.231772, 30.718708;104.232489, 30.714733;104.236282, 30.713888;104.237768, 30.717067;104.232532, 30.719974;104.229815, 30.720798;104.226954, 30.718379;104.221441, 30.719159;104.217748, 30.715577;104.215192, 30.711169;104.212442, 30.714631;104.208468, 30.717889;104.203753, 30.715955;104.19927, 30.717453;104.197849, 30.718741;104.195609, 30.716731;104.197181, 30.719738;104.198161, 30.72378;104.197158, 30.724459;104.198599, 30.727016;104.196865, 30.729009;104.195555, 30.732159;104.193577, 30.73258;104.191226, 30.728659;104.188889, 30.726157;104.18688, 30.729309;104.188804, 30.732679;104.187993, 30.735235;104.18479, 30.73583;104.182513, 30.736307;104.18235, 30.734139;104.176165, 30.734596;104.174237, 30.732956;104.176696, 30.732889;104.173928, 30.729581;104.17141, 30.7306;104.172776, 30.733599;104.171187, 30.73461;104.169181, 30.735418;104.171894, 30.739034;104.170933, 30.743628;104.170126, 30.744212;104.164874, 30.743448;104.159693, 30.744746;104.155995, 30.745669;104.146525, 30.74429;104.142811, 30.742693;104.140171, 30.744039;104.143528, 30.746029;104.146993, 30.749919;104.143424, 30.74982;104.141913, 30.753474;104.139484, 30.755701;104.138017, 30.752918;104.134812, 30.754955;104.132125, 30.754016;104.133277, 30.750475;104.134215, 30.74662;104.131009, 30.748438;104.131194, 30.745854;104.12701, 30.745622;104.124082, 30.746461;104.124932, 30.743497;104.122735, 30.739226;104.122656, 30.737536;104.120272, 30.738318;104.115891, 30.735086;104.112954, 30.735518;104.110758, 30.73807;104.108384, 30.73799;104.10938, 30.731889;104.108193, 30.728718;104.103639, 30.728929;104.100695, 30.728534;104.098146, 30.728077;104.095361, 30.726607;104.094827, 30.722986;104.095921, 30.720218;104.089939, 30.71959;104.088995, 30.722008;104.08654, 30.72285;104.082928, 30.72111;104.080372, 30.718873;104.078527, 30.720643;104.080178, 30.722596;104.079832, 30.723041;104.079087, 30.72361;104.078646, 30.723902;104.078446, 30.724051;104.078425, 30.724518;104.078075, 30.724541;104.077244, 30.72443;104.077189, 30.719592;104.077572, 30.714728;104.076703, 30.71287;104.07802, 30.70686;104.080128, 30.704204;104.084817, 30.703639;104.091476, 30.703164;104.09778, 30.701774;104.10046, 30.699797;104.099385, 30.69762;104.097955, 30.696228;104.098893, 30.693098;104.095386, 30.685677;104.101033, 30.682179;104.096188, 30.675861;104.098468, 30.674663;104.100764, 30.672386;104.103179, 30.670513;104.102605, 30.669128;104.10044, 30.668622;104.099067, 30.666414;104.098535, 30.664059;104.096289, 30.661238;104.09545, 30.660086;104.10318, 30.655592;104.116625, 30.649336;104.130525, 30.642928;104.134624, 30.640384;104.133831, 30.637788;104.135868, 30.632684;104.1341, 30.63162;104.131033, 30.632381;104.131636, 30.630077;104.133087, 30.62919;104.133914, 30.625299;104.13828, 30.623885;104.139776, 30.626603;104.141203, 30.626076;104.142936, 30.625415;104.145347, 30.62347;104.148072, 30.624362;104.148909, 30.626553;104.152314, 30.627454;104.154455, 30.628941;104.157705, 30.630398;104.15961, 30.628141;104.164618, 30.627479;104.164798, 30.62522;104.168685, 30.624776;104.168752, 30.626698;104.170166, 30.6281;104.169494, 30.630434;104.168486, 30.633105;104.167511, 30.636301;104.169713, 30.639101;104.171883, 30.641075;104.170534, 30.644714;104.170246, 30.648154;104.168329, 30.64985;104.164356, 30.653728;104.167384, 30.654591;104.16513, 30.656236;104.161973, 30.658276;104.16168, 30.660059;104.16237, 30.665327;104.160611, 30.670068;104.158238, 30.668545;104.160192, 30.666485;104.156359, 30.666734;104.154468, 30.668542;104.154735, 30.67293;104.159145, 30.672783;104.163018, 30.667887;104.16391, 30.670704;104.165568, 30.673924;104.167097, 30.675587;104.1678, 30.678688;104.169694, 30.679935;104.172301, 30.680694;104.173547, 30.680835;104.175179, 30.679197;104.17222, 30.678052;104.172074, 30.67685;104.175197, 30.676857;104.17831, 30.675126;104.18074, 30.676246;104.181001, 30.678488;104.182487, 30.678873;104.183214, 30.677886;104.18992, 30.677538;104.190571, 30.678807;104.190959, 30.679892;104.193114, 30.680019;104.197222, 30.680594;104.198148, 30.683285;104.198926, 30.687845;104.204297, 30.689769;104.206005, 30.689873;104.20635, 30.689145;104.206563, 30.688634;104.207534, 30.688725;104.208555, 30.689381;104.209932, 30.689513;104.2114, 30.689615;104.212605, 30.689023;104.213266, 30.6885;104.214357, 30.687728;104.215328, 30.687177;104.21633, 30.686464;104.217028, 30.686181;104.218007, 30.686006;104.219085, 30.685826;104.219878, 30.685563;104.220764, 30.688654;104.222075, 30.686552;104.2247, 30.686149;104.230204, 30.689235;104.234751, 30.689144;104.237642, 30.687414;104.237359, 30.689727;104.235356, 30.692374;104.237465, 30.691318;104.243121, 30.692698'
                ],
                isDistrict: true
              },
              {
                id: '4',
                name: '青羊区',
                lng: 104.06858,
                lat: 30.680472,
                count: 0,
                boundaries: [
                  '104.096188, 30.675861;104.094949, 30.676469;104.093664, 30.677441;104.092683, 30.678386;104.091448, 30.678773;104.090055, 30.678902;104.087905, 30.680019;104.084267, 30.682036;104.081747, 30.683589;104.077089, 30.684568;104.071047, 30.687866;104.069016, 30.687532;104.068146, 30.684757;104.067319, 30.684286;104.066072, 30.684344;104.064283, 30.684589;104.06278, 30.683602;104.061552, 30.682616;104.060022, 30.682101;104.059083, 30.681493;104.058884, 30.680585;104.058475, 30.679524;104.058105, 30.678895;104.057699, 30.677768;104.057302, 30.677053;104.057364, 30.676679;104.057365, 30.67558;104.057431, 30.674385;104.056001, 30.672843;104.054655, 30.671564;104.053229, 30.669474;104.046257, 30.67319;104.045155, 30.673701;104.044648, 30.673968;104.04369, 30.674915;104.042077, 30.675181;104.041072, 30.675246;104.040221, 30.676175;104.039289, 30.677445;104.037598, 30.677953;104.038803, 30.679854;104.03793, 30.680674;104.037792, 30.683305;104.038801, 30.684766;104.039151, 30.685561;104.037671, 30.685951;104.03639, 30.686279;104.035001, 30.687477;104.034006, 30.687834;104.033664, 30.68772;104.032938, 30.68734;104.031355, 30.688559;104.028502, 30.689034;104.026143, 30.689553;104.02481, 30.688924;104.023907, 30.687408;104.022988, 30.688494;104.021561, 30.688342;104.020555, 30.687963;104.019217, 30.689373;104.017873, 30.689467;104.017141, 30.691262;104.016205, 30.692074;104.014703, 30.692155;104.013898, 30.690913;104.01336, 30.690079;104.012643, 30.691319;104.010778, 30.691701;104.00975, 30.689695;104.008504, 30.690477;104.009876, 30.692602;104.01005, 30.69427;104.014065, 30.695146;104.017707, 30.695801;104.017807, 30.698422;104.016316, 30.69959;104.014304, 30.703075;104.015612, 30.705063;104.013394, 30.705257;104.010208, 30.703621;104.008376, 30.70288;104.007746, 30.705725;104.006614, 30.70931;104.003778, 30.709417;103.999812, 30.709227;103.996202, 30.711514;103.993803, 30.711495;103.995447, 30.709931;103.995941, 30.709776;103.996147, 30.709161;103.99549, 30.708848;103.99483, 30.708557;103.993919, 30.708282;103.993544, 30.707702;103.992924, 30.706878;103.993259, 30.706302;103.994633, 30.706171;103.995744, 30.706246;103.996308, 30.705867;103.996391, 30.70478;103.995963, 30.703858;103.995639, 30.703309;103.996058, 30.702163;103.996771, 30.701933;103.997595, 30.702066;103.997868, 30.700957;103.996695, 30.699916;103.995268, 30.700414;103.99007, 30.699384;103.989898, 30.697564;103.987259, 30.698668;103.985019, 30.701258;103.982575, 30.702673;103.981263, 30.704434;103.97954, 30.70569;103.980561, 30.707944;103.980223, 30.710896;103.97837, 30.710829;103.977592, 30.712341;103.977931, 30.714398;103.977426, 30.716372;103.975737, 30.717167;103.971901, 30.717716;103.969879, 30.717424;103.967282, 30.718705;103.967287, 30.721808;103.964581, 30.722869;103.962454, 30.722024;103.960304, 30.723055;103.960685, 30.72568;103.95982, 30.727782;103.951903, 30.726241;103.940874, 30.726272;103.938352, 30.725123;103.939725, 30.720565;103.939602, 30.71549;103.933304, 30.715007;103.932195, 30.709912;103.925757, 30.706439;103.927251, 30.701083;103.923223, 30.6966;103.917107, 30.690667;103.913646, 30.684094;103.911615, 30.683982;103.909818, 30.683702;103.908416, 30.684589;103.908772, 30.685723;103.909936, 30.686325;103.910366, 30.687084;103.909121, 30.688114;103.908592, 30.687331;103.907903, 30.686804;103.906332, 30.687148;103.904576, 30.688056;103.903122, 30.686759;103.904561, 30.683828;103.90707, 30.681256;103.910459, 30.681293;103.911941, 30.677757;103.915882, 30.677439;103.918621, 30.677216;103.919946, 30.676705;103.922838, 30.676779;103.928076, 30.675098;103.929445, 30.672504;103.932402, 30.671871;103.935665, 30.668289;103.934836, 30.665449;103.936497, 30.6647;103.938706, 30.66526;103.9414, 30.666836;103.944174, 30.666704;103.948062, 30.666841;103.94872, 30.664857;103.951437, 30.664036;103.952787, 30.665804;103.954262, 30.666476;103.955686, 30.664954;103.959287, 30.663941;103.961955, 30.664824;103.967615, 30.666643;103.967144, 30.669021;103.96754, 30.670286;103.972053, 30.667692;103.973703, 30.667948;103.977196, 30.667526;103.975851, 30.665669;103.974057, 30.664429;103.973714, 30.661006;103.976034, 30.660546;103.977777, 30.662699;103.98312, 30.666296;103.985035, 30.667856;103.987848, 30.664771;103.986945, 30.662378;103.989428, 30.663347;103.990853, 30.664838;103.992213, 30.666815;103.994071, 30.666305;103.99556, 30.663939;103.996906, 30.664225;103.997606, 30.666604;103.99965, 30.664366;104.000498, 30.662616;104.001156, 30.659883;104.003421, 30.66334;104.008035, 30.666302;104.011941, 30.665454;104.01203, 30.661867;104.014351, 30.658755;104.020756, 30.660993;104.025133, 30.663483;104.027413, 30.659697;104.031092, 30.657465;104.03768, 30.657056;104.04647, 30.657898;104.054193, 30.65751;104.05766, 30.657956;104.062698, 30.655222;104.066519, 30.653531;104.068061, 30.655216;104.074207, 30.664367;104.080904, 30.665721;104.085871, 30.673146;104.094651, 30.673301'
                ],
                isDistrict: true
              },
              {
                id: '5',
                name: '锦江区',
                lng: 104.123851,
                lat: 30.604369,
                count: 0,
                boundaries: [
                  '104.177013, 30.597304;104.172556, 30.599042;104.170157, 30.597284;104.171015, 30.595906;104.169151, 30.594936;104.163867, 30.597461;104.162667, 30.599964;104.160806, 30.602637;104.162811, 30.607904;104.164205, 30.610117;104.162887, 30.6121;104.161419, 30.612289;104.158637, 30.611994;104.156066, 30.613316;104.154279, 30.615899;104.152928, 30.618832;104.149517, 30.620888;104.149477, 30.621922;104.149105, 30.623144;104.147175, 30.623635;104.144752, 30.625386;104.142285, 30.624827;104.139892, 30.627607;104.140161, 30.624715;104.135612, 30.624113;104.131326, 30.627927;104.133093, 30.630252;104.129907, 30.631113;104.133099, 30.631907;104.13593, 30.632057;104.134034, 30.635842;104.135044, 30.638071;104.132305, 30.64221;104.124219, 30.645826;104.104653, 30.654897;104.095111, 30.659483;104.09592, 30.660715;104.098, 30.663351;104.09895, 30.665426;104.099574, 30.667805;104.101955, 30.668948;104.103214, 30.669781;104.10206, 30.671492;104.099673, 30.673516;104.097161, 30.675414;104.091315, 30.670525;104.08371, 30.670055;104.080259, 30.664367;104.072672, 30.658918;104.067427, 30.654387;104.06724, 30.653159;104.073008, 30.652617;104.081191, 30.651639;104.086871, 30.650218;104.091278, 30.647821;104.095428, 30.646009;104.09852, 30.641909;104.100824, 30.635889;104.098148, 30.632464;104.093118, 30.631926;104.091069, 30.628799;104.092148, 30.625431;104.091463, 30.623022;104.091849, 30.620355;104.093328, 30.616819;104.094755, 30.6139;104.094888, 30.612267;104.093605, 30.608805;104.091593, 30.607716;104.088613, 30.606584;104.088207, 30.603433;104.090043, 30.598409;104.088654, 30.596274;104.085557, 30.595079;104.084753, 30.59117;104.08586, 30.588518;104.085823, 30.584423;104.080162, 30.579154;104.080484, 30.576771;104.084639, 30.575701;104.08852, 30.57504;104.096784, 30.572838;104.103822, 30.576599;104.109939, 30.576467;104.111864, 30.575166;104.117197, 30.574996;104.121351, 30.570439;104.119825, 30.567383;104.119063, 30.566705;104.117402, 30.565094;104.117114, 30.563337;104.116599, 30.562865;104.116154, 30.561923;104.116022, 30.559793;104.115878, 30.555469;104.117084, 30.553497;104.118079, 30.552647;104.120301, 30.552854;104.121186, 30.553173;104.121442, 30.553962;104.121595, 30.554917;104.123457, 30.555026;104.124792, 30.55436;104.125629, 30.554246;104.126842, 30.554482;104.127601, 30.554647;104.127943, 30.554486;104.128261, 30.55421;104.128816, 30.554395;104.12998, 30.554356;104.130561, 30.553696;104.130942, 30.553259;104.1326, 30.553736;104.135285, 30.55834;104.13204, 30.55969;104.129948, 30.561969;104.132965, 30.566228;104.133074, 30.568186;104.138632, 30.569464;104.141344, 30.573496;104.142533, 30.574254;104.143756, 30.574645;104.144402, 30.574057;104.145287, 30.573956;104.147455, 30.574261;104.147967, 30.572295;104.150146, 30.57143;104.150846, 30.572224;104.151194, 30.570461;104.150936, 30.569464;104.153671, 30.566388;104.156022, 30.568247;104.158438, 30.567891;104.159311, 30.569669;104.157858, 30.572832;104.163024, 30.57197;104.164517, 30.568948;104.170179, 30.569346;104.172008, 30.5698;104.169967, 30.571954;104.168891, 30.571694;104.166535, 30.573126;104.16827, 30.573631;104.170123, 30.573848;104.172925, 30.573894;104.173618, 30.572278;104.174863, 30.573737;104.173785, 30.575942;104.17489, 30.579248;104.172867, 30.580281;104.171525, 30.581815;104.171125, 30.580048;104.172042, 30.576302;104.169978, 30.574974;104.169271, 30.578796;104.170203, 30.580257;104.167359, 30.581045;104.166089, 30.580823;104.166188, 30.582661;104.169101, 30.583814;104.169433, 30.585872;104.171728, 30.587564;104.174005, 30.589647;104.173211, 30.591769;104.174272, 30.595269;104.176844, 30.595581'
                ],
                isDistrict: true
              },
              {
                id: '6',
                name: '龙泉驿区',
                lng: 104.281508,
                lat: 30.563028,
                count: 0,
                boundaries: [
                  '104.461332, 30.648353;104.459642, 30.655391;104.453385, 30.656972;104.448095, 30.650227;104.448637, 30.645308;104.445624, 30.640737;104.440365, 30.64109;104.439386, 30.64417;104.439621, 30.654835;104.438869, 30.663896;104.442527, 30.667975;104.442509, 30.673;104.442429, 30.677602;104.439529, 30.679197;104.437105, 30.679535;104.435588, 30.679111;104.431192, 30.683876;104.430154, 30.684162;104.42886, 30.684112;104.425767, 30.687705;104.421349, 30.687106;104.419247, 30.68516;104.418166, 30.682259;104.416341, 30.680756;104.41183, 30.677551;104.411136, 30.675578;104.409786, 30.676052;104.405601, 30.678275;104.401491, 30.681052;104.40006, 30.681027;104.397123, 30.682759;104.39639, 30.68542;104.395714, 30.687801;104.396074, 30.690825;104.397888, 30.694917;104.396601, 30.699364;104.389187, 30.70211;104.382894, 30.702185;104.380937, 30.703249;104.379606, 30.703168;104.377342, 30.703205;104.374278, 30.70391;104.373145, 30.702281;104.371365, 30.700801;104.370387, 30.702557;104.369517, 30.702799;104.367319, 30.70245;104.360832, 30.704628;104.35886, 30.704827;104.352872, 30.710211;104.351872, 30.709307;104.349014, 30.712284;104.348261, 30.713388;104.348643, 30.713759;104.349021, 30.714826;104.348528, 30.715003;104.348171, 30.71553;104.347793, 30.71544;104.347469, 30.715511;104.346691, 30.71717;104.345716, 30.717615;104.345373, 30.718101;104.34548, 30.718331;104.345279, 30.718543;104.344559, 30.719358;104.341629, 30.718889;104.342562, 30.715959;104.340739, 30.712526;104.339022, 30.713766;104.33762, 30.715811;104.331205, 30.718381;104.329919, 30.71898;104.329877, 30.721009;104.321311, 30.723731;104.318419, 30.720529;104.313109, 30.721158;104.310985, 30.722241;104.308617, 30.723881;104.299021, 30.724739;104.295469, 30.722748;104.295761, 30.722013;104.29466, 30.720141;104.290611, 30.718605;104.286796, 30.719572;104.283825, 30.720085;104.280243, 30.723025;104.277286, 30.722532;104.27427, 30.719544;104.274915, 30.716368;104.273358, 30.714893;104.27206, 30.713567;104.269914, 30.709189;104.266426, 30.706955;104.267454, 30.704768;104.270203, 30.702488;104.267028, 30.69985;104.263467, 30.699398;104.261488, 30.698424;104.25947, 30.696897;104.260365, 30.69546;104.26113, 30.694545;104.262206, 30.693815;104.261702, 30.692477;104.259913, 30.693465;104.257709, 30.692726;104.258859, 30.69155;104.259137, 30.687937;104.258492, 30.686608;104.256358, 30.687178;104.25392, 30.685784;104.254059, 30.683969;104.256085, 30.684585;104.257214, 30.683083;104.255095, 30.681442;104.251546, 30.681589;104.248249, 30.680452;104.243895, 30.680372;104.239112, 30.683827;104.235571, 30.68784;104.232121, 30.68988;104.225253, 30.687036;104.22351, 30.685638;104.221875, 30.687973;104.219994, 30.686642;104.219485, 30.685853;104.218387, 30.685994;104.217395, 30.685975;104.216477, 30.686248;104.215668, 30.686868;104.214737, 30.6875;104.213479, 30.688357;104.21286, 30.689067;104.212191, 30.689137;104.210937, 30.689448;104.209346, 30.689318;104.207906, 30.689221;104.20694, 30.688465;104.206333, 30.688955;104.20616, 30.689417;104.205017, 30.69001;104.201669, 30.688692;104.197218, 30.685618;104.197778, 30.680855;104.194574, 30.681719;104.19184, 30.67971;104.190626, 30.679525;104.190613, 30.677996;104.18376, 30.677113;104.182909, 30.678387;104.181316, 30.679175;104.180685, 30.676664;104.17977, 30.675593;104.17706, 30.675109;104.173419, 30.676945;104.171462, 30.677544;104.174439, 30.678634;104.175329, 30.680866;104.17264, 30.680753;104.170392, 30.68021;104.16814, 30.678977;104.166471, 30.676898;104.166596, 30.674532;104.164099, 30.672625;104.166611, 30.668239;104.159742, 30.672747;104.155383, 30.673205;104.154302, 30.671819;104.155324, 30.667305;104.159765, 30.665;104.158286, 30.667417;104.160055, 30.669908;104.161631, 30.668048;104.162847, 30.661203;104.161793, 30.65859;104.163621, 30.656977;104.166779, 30.656044;104.165419, 30.653843;104.164098, 30.649626;104.169631, 30.649624;104.171002, 30.646287;104.171312, 30.643089;104.170121, 30.640733;104.168468, 30.637327;104.168727, 30.634072;104.168544, 30.631132;104.170641, 30.629173;104.168816, 30.627341;104.169425, 30.625452;104.165838, 30.624925;104.164672, 30.626082;104.163283, 30.628075;104.158433, 30.628898;104.154421, 30.630354;104.154297, 30.627436;104.149338, 30.626982;104.148284, 30.625382;104.148883, 30.623486;104.149395, 30.622174;104.149213, 30.621062;104.152534, 30.619224;104.152401, 30.61653;104.156191, 30.613683;104.157912, 30.612305;104.161335, 30.612172;104.162295, 30.612423;104.164792, 30.610614;104.162842, 30.608714;104.160358, 30.603032;104.162716, 30.60042;104.16365, 30.597552;104.168972, 30.594868;104.170943, 30.595846;104.170335, 30.597219;104.17223, 30.59877;104.176959, 30.597395;104.176529, 30.595447;104.173869, 30.594583;104.173092, 30.591589;104.174015, 30.589419;104.171545, 30.587542;104.169408, 30.585742;104.168733, 30.583703;104.165457, 30.582094;104.166253, 30.580779;104.167679, 30.581148;104.170185, 30.579587;104.169234, 30.576786;104.170485, 30.574914;104.172136, 30.576648;104.171014, 30.580458;104.171631, 30.581766;104.173133, 30.580201;104.174723, 30.578103;104.174182, 30.575573;104.174573, 30.572763;104.173575, 30.572394;104.172738, 30.573993;104.169227, 30.573714;104.167124, 30.573411;104.166879, 30.572938;104.169201, 30.571733;104.170674, 30.571581;104.17196, 30.569538;104.16916, 30.569274;104.163823, 30.569122;104.161148, 30.573629;104.158386, 30.571987;104.159609, 30.569972;104.16234, 30.567644;104.163482, 30.56444;104.160469, 30.560277;104.159241, 30.556237;104.163012, 30.556586;104.164343, 30.551914;104.167288, 30.547592;104.170373, 30.552031;104.174829, 30.549739;104.178583, 30.550203;104.181935, 30.544041;104.186715, 30.537287;104.186176, 30.540468;104.19154, 30.538138;104.191157, 30.534267;104.195441, 30.527573;104.192878, 30.524098;104.198569, 30.519412;104.201569, 30.515707;104.2028, 30.512029;104.204235, 30.509331;104.207194, 30.503201;104.205444, 30.497853;104.204368, 30.497113;104.206371, 30.496089;104.210241, 30.495253;104.209492, 30.493535;104.210214, 30.491016;104.211195, 30.491593;104.213873, 30.489673;104.211882, 30.487373;104.220113, 30.486882;104.224902, 30.484086;104.227582, 30.477834;104.230766, 30.473932;104.237557, 30.47501;104.240351, 30.473119;104.246521, 30.472497;104.258671, 30.473299;104.269371, 30.478347;104.265134, 30.488127;104.270607, 30.494868;104.288481, 30.498328;104.299445, 30.507062;104.314983, 30.505946;104.327516, 30.499968;104.333613, 30.49722;104.336929, 30.499334;104.341221, 30.501566;104.341478, 30.515487;104.337983, 30.517355;104.3305, 30.515088;104.332447, 30.524935;104.345258, 30.517295;104.348043, 30.511759;104.350893, 30.506217;104.346316, 30.492423;104.35156, 30.486327;104.357797, 30.488746;104.360232, 30.4914;104.365444, 30.488847;104.371963, 30.493388;104.379611, 30.494705;104.385799, 30.496636;104.390177, 30.496132;104.396627, 30.492677;104.405908, 30.497049;104.408254, 30.502605;104.403485, 30.50928;104.405356, 30.516912;104.411303, 30.514747;104.414162, 30.518298;104.423328, 30.521597;104.419678, 30.530556;104.4111, 30.533817;104.405784, 30.540809;104.410761, 30.565109;104.409889, 30.578247;104.408856, 30.587754;104.416915, 30.600334;104.418585, 30.601261;104.421823, 30.605108;104.4359, 30.609936;104.435912, 30.617083;104.442464, 30.614861;104.449988, 30.618676;104.455201, 30.621767;104.454054, 30.627434;104.458721, 30.631364;104.460825, 30.640812',
                  '104.314748, 30.501311;104.313635, 30.500967;104.312603, 30.501736;104.312277, 30.499982;104.314018, 30.499385'
                ],
                isDistrict: true
              },
              {
                id: '7',
                name: '温江区',
                lng: 103.862956,
                lat: 30.687734,
                count: 0,
                boundaries: [
                  '103.953585, 30.72669;103.951679, 30.730118;103.948684, 30.735293;103.941048, 30.737821;103.935915, 30.740315;103.932667, 30.742342;103.929403, 30.742587;103.928195, 30.745477;103.92372, 30.745928;103.91863, 30.744645;103.912822, 30.745902;103.907754, 30.747357;103.90635, 30.747923;103.905823, 30.748414;103.905631, 30.74773;103.904132, 30.746909;103.903406, 30.748067;103.902764, 30.749318;103.901142, 30.750607;103.899613, 30.75098;103.898502, 30.752106;103.897778, 30.752889;103.894275, 30.757004;103.889187, 30.758671;103.881445, 30.757814;103.882039, 30.752782;103.877276, 30.752562;103.873658, 30.753065;103.865151, 30.753713;103.862982, 30.757423;103.856797, 30.761234;103.849271, 30.76576;103.84466, 30.765025;103.839604, 30.771172;103.835427, 30.773708;103.831938, 30.77702;103.82973, 30.775477;103.826228, 30.781107;103.826143, 30.784329;103.823896, 30.787362;103.821714, 30.788459;103.818032, 30.783482;103.813915, 30.779933;103.808849, 30.781432;103.809297, 30.783555;103.810923, 30.784541;103.80918, 30.785866;103.806107, 30.787106;103.802684, 30.788746;103.804669, 30.792207;103.801721, 30.797299;103.798936, 30.79955;103.798292, 30.802972;103.79585, 30.805139;103.794886, 30.809376;103.793272, 30.813576;103.788636, 30.816811;103.78534, 30.814988;103.778185, 30.813919;103.774191, 30.814606;103.772183, 30.818189;103.767946, 30.82042;103.764937, 30.827739;103.764709, 30.830387;103.759528, 30.832895;103.758666, 30.835347;103.752043, 30.837329;103.747457, 30.839602;103.742696, 30.842507;103.73862, 30.842197;103.735747, 30.845505;103.733033, 30.8475;103.729149, 30.853263;103.72898, 30.857458;103.726837, 30.860398;103.721849, 30.867756;103.720135, 30.870058;103.717665, 30.872573;103.714823, 30.875281;103.711228, 30.878419;103.708112, 30.879775;103.707236, 30.884171;103.703262, 30.886129;103.697852, 30.888708;103.695781, 30.886614;103.698061, 30.878895;103.699878, 30.8693;103.704273, 30.861726;103.707032, 30.856345;103.708505, 30.84972;103.707417, 30.844187;103.712427, 30.834599;103.716091, 30.827847;103.721496, 30.821728;103.72224, 30.818512;103.722643, 30.814074;103.723414, 30.808376;103.725495, 30.799186;103.728491, 30.787499;103.728714, 30.77651;103.731797, 30.762537;103.735124, 30.753791;103.740221, 30.744636;103.743879, 30.736633;103.751297, 30.730429;103.759421, 30.722463;103.759525, 30.71448;103.759699, 30.708602;103.760086, 30.703105;103.762312, 30.697411;103.766365, 30.694063;103.766648, 30.689196;103.768312, 30.682894;103.770644, 30.679726;103.769859, 30.676849;103.769919, 30.673124;103.77311, 30.671343;103.770776, 30.665867;103.775883, 30.66556;103.778205, 30.661979;103.781668, 30.65769;103.781465, 30.652669;103.784739, 30.649755;103.788535, 30.643667;103.791523, 30.638863;103.790994, 30.635936;103.792133, 30.633225;103.795392, 30.631325;103.800056, 30.62871;103.802406, 30.628863;103.807094, 30.630624;103.811624, 30.626609;103.818678, 30.618693;103.823987, 30.621464;103.827937, 30.619119;103.835225, 30.620838;103.839017, 30.620842;103.844085, 30.619093;103.846407, 30.619769;103.849595, 30.623661;103.853007, 30.621533;103.855108, 30.626014;103.855158, 30.630572;103.851212, 30.63508;103.852452, 30.640929;103.859173, 30.634624;103.863939, 30.632831;103.866545, 30.637069;103.866103, 30.644375;103.86429, 30.649126;103.863123, 30.652259;103.866768, 30.65024;103.874032, 30.653929;103.873729, 30.656844;103.878695, 30.661472;103.880323, 30.669029;103.882734, 30.667126;103.885042, 30.666669;103.883608, 30.660552;103.883536, 30.656829;103.885371, 30.653425;103.890716, 30.654928;103.896284, 30.65364;103.901428, 30.654798;103.896928, 30.656382;103.898405, 30.660083;103.90149, 30.663269;103.901175, 30.670614;103.911608, 30.669813;103.914213, 30.670808;103.919712, 30.670558;103.922672, 30.671623;103.925971, 30.671982;103.929403, 30.672333;103.928652, 30.674731;103.924387, 30.676378;103.920311, 30.676854;103.91878, 30.677063;103.916482, 30.677398;103.913611, 30.677723;103.910573, 30.680728;103.907548, 30.681421;103.904867, 30.683266;103.902892, 30.686385;103.90411, 30.688038;103.906132, 30.687242;103.907505, 30.686929;103.908518, 30.687201;103.908922, 30.688024;103.910202, 30.687508;103.910121, 30.686328;103.908898, 30.685876;103.908278, 30.684943;103.909284, 30.683717;103.910742, 30.683947;103.913419, 30.683238;103.916152, 30.69023;103.921498, 30.693962;103.927331, 30.7005;103.925469, 30.705858;103.931236, 30.709127;103.932749, 30.714267;103.938666, 30.715127;103.940312, 30.720201;103.938356, 30.723989;103.93923, 30.727026;103.948147, 30.726265'
                ],
                isDistrict: true
              },
              {
                id: '8',
                name: '双流区',
                lng: 103.929812,
                lat: 30.581186,
                count: 1,
                boundaries: [
                  '104.27703, 30.464315;104.267214, 30.466689;104.259181, 30.463554;104.253589, 30.468668;104.243563, 30.471834;104.238419, 30.474966;104.231665, 30.474473;104.228865, 30.474506;104.228966, 30.479396;104.222255, 30.484504;104.213583, 30.486903;104.21263, 30.489198;104.21155, 30.49189;104.210826, 30.490842;104.208891, 30.492426;104.210237, 30.494178;104.207142, 30.496106;104.205462, 30.496222;104.204745, 30.497727;104.206689, 30.499672;104.204755, 30.50948;104.202301, 30.510382;104.203411, 30.513471;104.197819, 30.518519;104.194005, 30.523899;104.195232, 30.527099;104.192523, 30.532279;104.192564, 30.536986;104.187918, 30.540124;104.185712, 30.53866;104.18218, 30.538324;104.182934, 30.545067;104.176391, 30.550994;104.170166, 30.553402;104.170275, 30.549705;104.166295, 30.548593;104.16409, 30.555897;104.160909, 30.555855;104.1566, 30.558287;104.162764, 30.56272;104.159944, 30.56712;104.161117, 30.570036;104.159222, 30.569063;104.157961, 30.56793;104.155685, 30.565888;104.154408, 30.568288;104.150736, 30.569701;104.151057, 30.571719;104.150654, 30.572178;104.14987, 30.571364;104.148078, 30.573449;104.146787, 30.574491;104.144935, 30.573875;104.144181, 30.574578;104.143396, 30.574454;104.14196, 30.574188;104.140325, 30.571873;104.134889, 30.56958;104.133202, 30.56743;104.131587, 30.564915;104.131847, 30.561416;104.131461, 30.558679;104.135242, 30.556045;104.131355, 30.553155;104.130547, 30.553469;104.130525, 30.553933;104.129625, 30.55433;104.128554, 30.554377;104.128058, 30.554242;104.1278, 30.554525;104.127418, 30.554671;104.126426, 30.554398;104.12523, 30.554164;104.124446, 30.554614;104.122237, 30.55504;104.121534, 30.554551;104.121523, 30.553602;104.120757, 30.55288;104.119765, 30.552855;104.118036, 30.55277;104.116637, 30.554223;104.115715, 30.558135;104.115749, 30.561181;104.116604, 30.562294;104.116629, 30.563092;104.117343, 30.563555;104.11761, 30.565406;104.119882, 30.567024;104.119765, 30.567731;104.120044, 30.573671;104.114223, 30.575015;104.111725, 30.575962;104.110223, 30.577184;104.098992, 30.575743;104.093129, 30.574467;104.086488, 30.568734;104.088985, 30.564633;104.090638, 30.559884;104.085421, 30.556706;104.080924, 30.554693;104.082758, 30.54794;104.086904, 30.546095;104.087057, 30.543425;104.081538, 30.542669;104.077991, 30.540899;104.072126, 30.537103;104.068252, 30.536242;104.066916, 30.54055;104.061253, 30.542396;104.057073, 30.546131;104.051314, 30.548179;104.048998, 30.547306;104.050517, 30.545059;104.051179, 30.54344;104.050142, 30.541227;104.047768, 30.538436;104.048672, 30.537673;104.049967, 30.535863;104.048563, 30.532728;104.041891, 30.536431;104.043813, 30.540065;104.044742, 30.544615;104.043005, 30.548276;104.038004, 30.54799;104.031812, 30.558789;104.035338, 30.569758;104.037837, 30.568252;104.04398, 30.575294;104.0407, 30.576287;104.037379, 30.583734;104.029514, 30.581576;104.021166, 30.59104;104.014611, 30.592631;104.015351, 30.590209;104.015494, 30.588981;104.014283, 30.587048;104.012967, 30.586299;104.01215, 30.585675;104.011838, 30.584098;104.012003, 30.583062;104.009507, 30.583378;104.007467, 30.584787;104.004297, 30.587584;103.999002, 30.590693;103.988993, 30.587812;103.985435, 30.584138;103.982551, 30.580385;103.982694, 30.578002;103.978892, 30.57766;103.975687, 30.578692;103.972838, 30.581138;103.974834, 30.582744;103.97433, 30.583626;103.97226, 30.58399;103.972608, 30.58627;103.971217, 30.587731;103.972554, 30.589845;103.972097, 30.593327;103.973201, 30.596399;103.971886, 30.598646;103.973088, 30.604805;103.972915, 30.610599;103.972815, 30.612936;103.971892, 30.612225;103.97019, 30.611071;103.969362, 30.612284;103.96671, 30.613381;103.963035, 30.615174;103.962352, 30.61979;103.962966, 30.622879;103.962117, 30.625074;103.963627, 30.626329;103.965913, 30.628254;103.967964, 30.629399;103.967647, 30.631102;103.965264, 30.633259;103.963147, 30.636062;103.960965, 30.637563;103.959591, 30.639263;103.960673, 30.642169;103.958872, 30.643459;103.958243, 30.645508;103.95901, 30.649388;103.958421, 30.651036;103.956017, 30.650439;103.954546, 30.651974;103.954506, 30.654711;103.957165, 30.656874;103.957746, 30.659985;103.95661, 30.662644;103.955961, 30.664666;103.954547, 30.666398;103.952855, 30.666161;103.951942, 30.664125;103.949101, 30.664125;103.948548, 30.666561;103.944562, 30.666665;103.94166, 30.666982;103.939047, 30.665191;103.937217, 30.665167;103.935031, 30.665188;103.935714, 30.667699;103.933508, 30.671433;103.929403, 30.672333;103.925971, 30.671982;103.922672, 30.671623;103.919712, 30.670558;103.914213, 30.670808;103.911608, 30.669813;103.901175, 30.670614;103.90149, 30.663269;103.898405, 30.660083;103.896928, 30.656382;103.901428, 30.654798;103.896284, 30.65364;103.890716, 30.654928;103.885371, 30.653425;103.883536, 30.656829;103.883608, 30.660552;103.885042, 30.666669;103.882734, 30.667126;103.880323, 30.669029;103.878695, 30.661472;103.873729, 30.656844;103.874032, 30.653929;103.866768, 30.65024;103.863123, 30.652259;103.86429, 30.649126;103.866103, 30.644375;103.866545, 30.637069;103.863939, 30.632831;103.859173, 30.634624;103.852452, 30.640929;103.851212, 30.63508;103.855158, 30.630572;103.855108, 30.626014;103.853007, 30.621533;103.849595, 30.623661;103.846407, 30.619769;103.844085, 30.619093;103.839017, 30.620842;103.835225, 30.620838;103.827937, 30.619119;103.823987, 30.621464;103.818678, 30.618693;103.811624, 30.626609;103.807094, 30.630624;103.802406, 30.628863;103.802734, 30.62264;103.802569, 30.620417;103.806871, 30.616345;103.805577, 30.610668;103.807032, 30.610708;103.810127, 30.609396;103.812393, 30.597388;103.813739, 30.595955;103.816482, 30.597022;103.818908, 30.591632;103.82793, 30.585266;103.829941, 30.572046;103.826134, 30.556406;103.824059, 30.551016;103.821023, 30.550382;103.822889, 30.54699;103.824545, 30.543236;103.818978, 30.537178;103.825277, 30.534611;103.831106, 30.527327;103.833859, 30.514295;103.83721, 30.507394;103.84415, 30.510996;103.851596, 30.510087;103.856067, 30.509629;103.858809, 30.509021;103.862345, 30.511129;103.865906, 30.510101;103.869512, 30.514127;103.873181, 30.513501;103.875197, 30.511898;103.878569, 30.512204;103.884112, 30.50863;103.886864, 30.505769;103.891833, 30.503819;103.889934, 30.500508;103.895094, 30.501609;103.905041, 30.501805;103.912258, 30.495297;103.916405, 30.48784;103.916512, 30.483863;103.919903, 30.481055;103.923889, 30.469407;103.920672, 30.466801;103.920427, 30.459175;103.916821, 30.455859;103.919352, 30.453485;103.92306, 30.452287;103.923086, 30.450005;103.927178, 30.446554;103.932152, 30.442397;103.931518, 30.439966;103.935022, 30.437419;103.934103, 30.433296;103.93956, 30.431063;103.940119, 30.428131;103.941659, 30.427064;103.940039, 30.423027;103.940745, 30.412947;103.941096, 30.403524;103.937064, 30.39458;103.936501, 30.387479;103.933306, 30.382513;103.926744, 30.37909;103.928572, 30.369069;103.9343, 30.367262;103.940584, 30.365072;103.948781, 30.364477;103.944808, 30.360121;103.94349, 30.352079;103.948359, 30.345133;103.954614, 30.336016;103.960759, 30.329799;103.961916, 30.327417;103.971405, 30.326505;103.974541, 30.315908;103.983881, 30.313448;103.981749, 30.304455;103.981046, 30.299451;103.981838, 30.290586;103.991267, 30.287766;103.995205, 30.278974;104.002294, 30.276234;104.001668, 30.272512;104.006789, 30.269142;104.00828, 30.271614;104.012664, 30.269079;104.01509, 30.269728;104.019297, 30.271729;104.019779, 30.27387;104.023637, 30.275987;104.025185, 30.27523;104.026169, 30.273119;104.033156, 30.278539;104.036393, 30.277502;104.036715, 30.269993;104.047012, 30.274994;104.055861, 30.278152;104.057391, 30.274119;104.058142, 30.27161;104.058578, 30.269408;104.057349, 30.268503;104.058002, 30.266366;104.061337, 30.266336;104.070828, 30.272725;104.071715, 30.266512;104.077711, 30.25997;104.079126, 30.263001;104.085054, 30.263127;104.084448, 30.256563;104.090113, 30.2559;104.097636, 30.256729;104.098608, 30.253337;104.100901, 30.249505;104.103708, 30.24485;104.116758, 30.243023;104.119787, 30.234852;104.126709, 30.233397;104.134589, 30.235943;104.147256, 30.241953;104.158164, 30.253318;104.158627, 30.260017;104.157991, 30.266018;104.159076, 30.273235;104.163698, 30.281197;104.171793, 30.288358;104.174686, 30.297688;104.178563, 30.305013;104.183273, 30.31315;104.186303, 30.320909;104.187634, 30.328588;104.193239, 30.334601;104.205307, 30.343815;104.205789, 30.354942;104.212636, 30.366979;104.224451, 30.379922;104.231061, 30.39442;104.228277, 30.399105;104.23741, 30.405054;104.236767, 30.414886;104.241176, 30.424435;104.249942, 30.42551;104.257539, 30.425766;104.257541, 30.430489;104.260511, 30.441062;104.271301, 30.454524',
                  '103.967037, 30.313661;103.960345, 30.319034;103.954545, 30.312662;103.955417, 30.309406;103.964219, 30.312855'
                ],
                isDistrict: true
              },
              {
                id: '9',
                name: '郫都区',
                lng: 103.906999,
                lat: 30.801376,
                count: 0,
                boundaries: [
                  '104.05506, 30.757161;104.047379, 30.760855;104.037932, 30.767708;104.037672, 30.772274;104.038282, 30.778221;104.036197, 30.782034;104.040873, 30.78406;104.044948, 30.782335;104.049294, 30.780753;104.051846, 30.783304;104.050111, 30.784824;104.05053, 30.787998;104.049886, 30.790756;104.049103, 30.793808;104.045832, 30.794443;104.043359, 30.792645;104.042576, 30.791036;104.040533, 30.794177;104.039862, 30.798246;104.037076, 30.801842;104.033966, 30.804888;104.033306, 30.809826;104.031398, 30.81099;104.030533, 30.811286;104.029741, 30.811224;104.028995, 30.811454;104.027915, 30.811505;104.027193, 30.811858;104.026028, 30.812266;104.024954, 30.812565;104.024978, 30.813337;104.024944, 30.816007;104.023181, 30.82262;104.015597, 30.825836;104.007373, 30.827671;104.003468, 30.827786;103.997938, 30.829019;103.995994, 30.832518;103.992164, 30.833444;103.985831, 30.835857;103.979987, 30.839637;103.972887, 30.842069;103.974142, 30.844981;103.972478, 30.849862;103.967775, 30.852319;103.965982, 30.854677;103.964386, 30.857707;103.959975, 30.858613;103.956394, 30.862577;103.951546, 30.861665;103.949256, 30.867348;103.942834, 30.872036;103.94678, 30.876371;103.952479, 30.8809;103.952114, 30.885513;103.952552, 30.890257;103.953253, 30.893405;103.950298, 30.897245;103.955697, 30.90014;103.955781, 30.905304;103.950479, 30.907117;103.949901, 30.909202;103.953078, 30.907379;103.952143, 30.909479;103.950772, 30.911073;103.947893, 30.911902;103.94148, 30.913198;103.93821, 30.915507;103.93288, 30.917384;103.925738, 30.919427;103.922788, 30.922364;103.918698, 30.926092;103.911449, 30.93331;103.903588, 30.932513;103.89407, 30.935853;103.889642, 30.936012;103.885115, 30.937189;103.878127, 30.937761;103.867613, 30.93989;103.861351, 30.9417;103.854626, 30.941593;103.854309, 30.936621;103.851598, 30.934422;103.848957, 30.932155;103.844006, 30.933827;103.835445, 30.9351;103.833871, 30.939559;103.831456, 30.944427;103.828101, 30.946822;103.823267, 30.949341;103.817536, 30.951161;103.808268, 30.949585;103.802568, 30.95143;103.800051, 30.954904;103.794687, 30.958474;103.786037, 30.963316;103.781099, 30.96559;103.777518, 30.963596;103.776102, 30.962823;103.774489, 30.959615;103.773971, 30.955188;103.775023, 30.953939;103.774972, 30.951613;103.776871, 30.948995;103.775562, 30.94605;103.774681, 30.942944;103.774626, 30.93995;103.777866, 30.93734;103.776656, 30.932932;103.777071, 30.930862;103.780227, 30.92838;103.782112, 30.92479;103.77715, 30.925174;103.7739, 30.923337;103.769091, 30.922391;103.768729, 30.919663;103.768143, 30.915127;103.765668, 30.913879;103.767943, 30.910465;103.766756, 30.907794;103.762246, 30.905335;103.760671, 30.904295;103.758359, 30.905522;103.756105, 30.906002;103.754507, 30.905034;103.753909, 30.902902;103.757664, 30.90085;103.759497, 30.897571;103.763921, 30.896762;103.764297, 30.894334;103.766193, 30.889691;103.76488, 30.887367;103.759349, 30.88863;103.761087, 30.88513;103.757677, 30.882831;103.753416, 30.885355;103.749837, 30.884608;103.747076, 30.883916;103.743719, 30.884664;103.741079, 30.885074;103.740976, 30.882582;103.741241, 30.880319;103.742252, 30.876919;103.74161, 30.873135;103.735289, 30.871043;103.733324, 30.869773;103.729474, 30.86683;103.724135, 30.867668;103.726837, 30.860398;103.72898, 30.857458;103.729149, 30.853263;103.733033, 30.8475;103.735747, 30.845505;103.73862, 30.842197;103.742696, 30.842507;103.747457, 30.839602;103.752043, 30.837329;103.758666, 30.835347;103.759528, 30.832895;103.764709, 30.830387;103.764937, 30.827739;103.767946, 30.82042;103.772183, 30.818189;103.774191, 30.814606;103.778185, 30.813919;103.78534, 30.814988;103.788636, 30.816811;103.793272, 30.813576;103.794886, 30.809376;103.79585, 30.805139;103.798292, 30.802972;103.798936, 30.79955;103.801721, 30.797299;103.804669, 30.792207;103.802684, 30.788746;103.806107, 30.787106;103.80918, 30.785866;103.810923, 30.784541;103.809297, 30.783555;103.808849, 30.781432;103.813915, 30.779933;103.818032, 30.783482;103.821714, 30.788459;103.823896, 30.787362;103.826143, 30.784329;103.826228, 30.781107;103.82973, 30.775477;103.831938, 30.77702;103.835427, 30.773708;103.839604, 30.771172;103.84466, 30.765025;103.849271, 30.76576;103.856797, 30.761234;103.862982, 30.757423;103.865151, 30.753713;103.873658, 30.753065;103.877276, 30.752562;103.882039, 30.752782;103.881445, 30.757814;103.889187, 30.758671;103.894275, 30.757004;103.897778, 30.752889;103.898502, 30.752106;103.899613, 30.75098;103.901142, 30.750607;103.902764, 30.749318;103.903406, 30.748067;103.904132, 30.746909;103.905631, 30.74773;103.905823, 30.748414;103.90635, 30.747923;103.907754, 30.747357;103.912822, 30.745902;103.91863, 30.744645;103.92372, 30.745928;103.928195, 30.745477;103.929403, 30.742587;103.932667, 30.742342;103.935915, 30.740315;103.941048, 30.737821;103.948684, 30.735293;103.951679, 30.730118;103.953585, 30.72669;103.960597, 30.727591;103.965756, 30.728447;103.968724, 30.727511;103.969165, 30.73088;103.971874, 30.732232;103.972871, 30.733071;103.973542, 30.732761;103.973606, 30.731917;103.973793, 30.731023;103.974119, 30.729773;103.973385, 30.729173;103.972657, 30.728773;103.973579, 30.727649;103.97731, 30.725283;103.978113, 30.725087;103.978106, 30.727762;103.979701, 30.724868;103.980857, 30.72416;103.981777, 30.723293;103.983626, 30.725477;103.985098, 30.727933;103.981817, 30.731127;103.979739, 30.733259;103.983116, 30.735853;103.986059, 30.735526;103.989245, 30.737525;103.990827, 30.737319;103.994001, 30.733713;103.995541, 30.731479;103.997174, 30.732191;103.999913, 30.730262;104.000733, 30.733464;104.003329, 30.737286;104.006584, 30.74115;104.010403, 30.744149;104.003146, 30.750484;104.004056, 30.754975;104.00473, 30.759453;104.002395, 30.760263;104.00567, 30.761051;104.008417, 30.764101;104.015964, 30.762626;104.02028, 30.764587;104.020513, 30.762578;104.023396, 30.76033;104.022298, 30.758433;104.020862, 30.756893;104.019185, 30.75545;104.02095, 30.753995;104.025569, 30.754031;104.027632, 30.754686;104.027632, 30.752179;104.027844, 30.749981;104.027275, 30.747801;104.029749, 30.747347;104.032476, 30.747058;104.034292, 30.744771;104.032033, 30.744523;104.033881, 30.741508;104.037457, 30.738818;104.042068, 30.736545;104.041268, 30.738497;104.041587, 30.740811;104.04396, 30.742933;104.038868, 30.7478;104.037773, 30.751564;104.042504, 30.749318;104.047034, 30.751767;104.048852, 30.757324;104.054249, 30.757217',
                  '103.970416, 30.787906;103.966629, 30.789316;103.961208, 30.790539;103.956954, 30.787395;103.957175, 30.784164;103.957731, 30.783044;103.957137, 30.782762;103.955695, 30.782949;103.953365, 30.78428;103.951308, 30.781365;103.952166, 30.780679;103.953305, 30.780296;103.953941, 30.780267;103.95417, 30.779816;103.954663, 30.779296;103.955194, 30.777974;103.955107, 30.775288;103.958976, 30.774914;103.962591, 30.778011;103.966683, 30.780297;103.966698, 30.781748;103.96969, 30.784575;103.970331, 30.787246'
                ],
                isDistrict: true
              },
              {
                id: '10',
                name: '新都区',
                lng: 104.164994,
                lat: 30.829938,
                count: 1,
                boundaries: [
                  '104.334122, 30.739705;104.330717, 30.741934;104.330077, 30.746194;104.325842, 30.752078;104.325335, 30.755889;104.323965, 30.756501;104.323082, 30.753465;104.31953, 30.753293;104.317729, 30.752471;104.312554, 30.749131;104.306942, 30.752735;104.305485, 30.752583;104.304092, 30.750443;104.298686, 30.749497;104.296321, 30.751098;104.295159, 30.750192;104.292881, 30.747677;104.293163, 30.745792;104.29293, 30.744172;104.290416, 30.743035;104.28636, 30.743478;104.286696, 30.745987;104.285735, 30.746718;104.283771, 30.74702;104.280217, 30.747371;104.273607, 30.750522;104.272638, 30.753009;104.264202, 30.75777;104.265633, 30.761211;104.267698, 30.762091;104.273977, 30.765181;104.274331, 30.771092;104.279008, 30.772283;104.273824, 30.779562;104.270094, 30.780234;104.2664, 30.782607;104.267795, 30.7868;104.264154, 30.791528;104.263842, 30.7951;104.263587, 30.800228;104.260409, 30.802503;104.256902, 30.805587;104.259647, 30.809891;104.254405, 30.809688;104.246515, 30.809658;104.248354, 30.811387;104.247276, 30.818064;104.24468, 30.81918;104.244635, 30.821454;104.241416, 30.820693;104.238954, 30.826227;104.240076, 30.832745;104.249426, 30.83575;104.255135, 30.835653;104.25109, 30.839075;104.250299, 30.840498;104.252564, 30.841397;104.254294, 30.843106;104.249149, 30.844315;104.245888, 30.845105;104.247308, 30.847408;104.245826, 30.849989;104.248718, 30.85627;104.244791, 30.855534;104.244861, 30.859354;104.241999, 30.860838;104.238547, 30.864118;104.237319, 30.8656;104.232579, 30.866629;104.227957, 30.868076;104.219753, 30.86928;104.220136, 30.865012;104.216736, 30.86651;104.216654, 30.870432;104.212774, 30.871626;104.214251, 30.869942;104.2099, 30.868191;104.20752, 30.864273;104.200284, 30.867225;104.194818, 30.87183;104.189678, 30.869672;104.180689, 30.8724;104.181654, 30.866386;104.179093, 30.866187;104.177329, 30.863135;104.175971, 30.861594;104.173738, 30.862516;104.173216, 30.864155;104.171818, 30.865262;104.172799, 30.866751;104.173031, 30.868331;104.171334, 30.869296;104.170633, 30.872549;104.167845, 30.876441;104.165069, 30.876066;104.172324, 30.877618;104.17513, 30.879175;104.180065, 30.88341;104.17657, 30.884172;104.177388, 30.889718;104.17669, 30.893708;104.183778, 30.896315;104.188366, 30.898752;104.18996, 30.905367;104.193106, 30.90532;104.191681, 30.909253;104.196937, 30.917116;104.191746, 30.918969;104.18614, 30.914025;104.180009, 30.915469;104.177032, 30.923815;104.165771, 30.921479;104.156771, 30.919424;104.149932, 30.921851;104.145948, 30.920638;104.138939, 30.920701;104.132215, 30.918041;104.127814, 30.917282;104.119426, 30.920298;104.104967, 30.918367;104.101283, 30.919554;104.090348, 30.920859;104.085275, 30.922395;104.082529, 30.923543;104.079046, 30.924515;104.075001, 30.931522;104.075764, 30.936312;104.075823, 30.943221;104.073937, 30.947937;104.070669, 30.951944;104.06832, 30.960521;104.062178, 30.964691;104.058806, 30.970444;104.052924, 30.971281;104.047567, 30.966021;104.043253, 30.965754;104.039156, 30.966926;104.035383, 30.964986;104.034439, 30.963486;104.031924, 30.960776;104.031102, 30.958285;104.022753, 30.955532;104.022296, 30.951814;104.019065, 30.948269;104.013146, 30.948133;104.00931, 30.949154;104.010004, 30.946704;104.006394, 30.94354;103.994663, 30.944175;103.988521, 30.944151;103.983048, 30.941729;103.978341, 30.937411;103.973639, 30.934485;103.973096, 30.929355;103.97093, 30.921952;103.966046, 30.922404;103.959644, 30.92314;103.952217, 30.926649;103.945143, 30.928409;103.925685, 30.928776;103.914827, 30.930614;103.914375, 30.927235;103.92115, 30.92394;103.923502, 30.92077;103.929958, 30.918205;103.937001, 30.916307;103.940873, 30.913455;103.944757, 30.912699;103.949585, 30.911694;103.951595, 30.909897;103.953008, 30.908138;103.951756, 30.907925;103.949233, 30.908651;103.953605, 30.905309;103.955755, 30.903278;103.952999, 30.898434;103.951194, 30.895481;103.9537, 30.892071;103.951032, 30.887317;103.954313, 30.881904;103.951384, 30.876487;103.944933, 30.874313;103.946616, 30.869814;103.950623, 30.863189;103.954008, 30.861673;103.958965, 30.860232;103.962473, 30.857414;103.966669, 30.856481;103.966435, 30.852724;103.971643, 30.851251;103.973968, 30.846453;103.97261, 30.843239;103.977468, 30.839451;103.982825, 30.839209;103.989888, 30.833034;103.995058, 30.833874;103.996505, 30.829849;104.001095, 30.829727;104.005568, 30.827519;104.012933, 30.826054;104.021666, 30.824118;104.024423, 30.818006;104.025287, 30.813988;104.02487, 30.812859;104.02569, 30.812426;104.026972, 30.812182;104.027448, 30.811399;104.028681, 30.811456;104.029519, 30.811455;104.03025, 30.811235;104.030921, 30.811137;104.032018, 30.811045;104.034014, 30.807162;104.036055, 30.803591;104.039085, 30.80055;104.039546, 30.794622;104.04187, 30.791966;104.04405, 30.791205;104.04361, 30.793563;104.047808, 30.79427;104.049633, 30.792469;104.050329, 30.788984;104.05024, 30.786525;104.052155, 30.784133;104.051637, 30.781193;104.046537, 30.781728;104.042383, 30.783666;104.037137, 30.782876;104.037139, 30.779598;104.037938, 30.774281;104.037914, 30.770399;104.042735, 30.763819;104.053344, 30.759079;104.058776, 30.755638;104.064687, 30.750256;104.068901, 30.746959;104.074157, 30.742856;104.079535, 30.747013;104.083937, 30.754275;104.093044, 30.756782;104.101887, 30.760702;104.1034, 30.76479;104.101352, 30.767139;104.101264, 30.768952;104.103532, 30.770692;104.102508, 30.771894;104.100631, 30.771086;104.096676, 30.770959;104.095964, 30.772266;104.094535, 30.773016;104.091713, 30.771319;104.088449, 30.771133;104.086742, 30.768099;104.084948, 30.76787;104.083073, 30.767054;104.081839, 30.768109;104.081469, 30.769833;104.080306, 30.768251;104.077662, 30.767944;104.076359, 30.76989;104.076284, 30.771047;104.078063, 30.770608;104.078654, 30.772351;104.077626, 30.776721;104.078889, 30.783304;104.079036, 30.784706;104.07791, 30.785865;104.076299, 30.786902;104.074639, 30.787138;104.074081, 30.78639;104.073199, 30.785681;104.072241, 30.78551;104.071081, 30.78498;104.070374, 30.785572;104.070293, 30.78647;104.070641, 30.787185;104.070858, 30.787905;104.070336, 30.788337;104.069278, 30.787679;104.068476, 30.787355;104.068059, 30.787824;104.068391, 30.788282;104.067963, 30.788664;104.067124, 30.788934;104.066269, 30.789628;104.065157, 30.789556;104.065323, 30.788743;104.064963, 30.788132;104.064594, 30.788558;104.064073, 30.789129;104.063501, 30.789976;104.06398, 30.790145;104.064637, 30.790653;104.064714, 30.792099;104.063777, 30.793102;104.062308, 30.793148;104.064776, 30.794448;104.068012, 30.796573;104.06947, 30.801649;104.067568, 30.807419;104.072546, 30.80756;104.078337, 30.810984;104.086756, 30.811629;104.089032, 30.809926;104.091109, 30.81191;104.092597, 30.812897;104.0964, 30.809516;104.093882, 30.806917;104.093371, 30.804088;104.09646, 30.806029;104.099143, 30.807729;104.100423, 30.80469;104.099431, 30.802733;104.09742, 30.799934;104.10308, 30.801078;104.108009, 30.799853;104.109018, 30.795615;104.112187, 30.794509;104.12323, 30.794225;104.12714, 30.790344;104.132401, 30.78589;104.134658, 30.782547;104.132285, 30.781047;104.131464, 30.778999;104.128341, 30.777225;104.125765, 30.775531;104.126034, 30.772375;104.132447, 30.768338;104.141252, 30.769034;104.14669, 30.767373;104.145136, 30.762175;104.146293, 30.753769;104.147859, 30.748554;104.140479, 30.744974;104.141521, 30.743802;104.144938, 30.742916;104.149917, 30.74589;104.158401, 30.744989;104.16058, 30.745292;104.167488, 30.743588;104.170631, 30.744335;104.17155, 30.741623;104.170273, 30.737781;104.169787, 30.734309;104.172195, 30.734695;104.172845, 30.732559;104.172178, 30.729602;104.176605, 30.731775;104.17552, 30.732881;104.173927, 30.733734;104.178273, 30.734747;104.182641, 30.734959;104.183024, 30.736491;104.185855, 30.735494;104.18841, 30.734735;104.18873, 30.731327;104.186857, 30.728639;104.189454, 30.726135;104.190927, 30.730041;104.194648, 30.732867;104.196811, 30.731113;104.197742, 30.728288;104.197622, 30.725464;104.197346, 30.723874;104.199299, 30.722481;104.195474, 30.71839;104.196483, 30.716332;104.199462, 30.718355;104.199416, 30.716832;104.205787, 30.716522;104.209517, 30.717667;104.21353, 30.713885;104.218889, 30.712666;104.217582, 30.717257;104.223011, 30.718123;104.227474, 30.720214;104.230336, 30.720154;104.234928, 30.719126;104.238035, 30.716475;104.234444, 30.713212;104.232641, 30.71623;104.231107, 30.715937;104.230935, 30.713914;104.229504, 30.711033;104.232957, 30.707776;104.238213, 30.70634;104.232693, 30.702454;104.234702, 30.700263;104.235456, 30.6984;104.238221, 30.696153;104.24202, 30.696318;104.24241, 30.692723;104.236798, 30.691279;104.235225, 30.691402;104.237674, 30.68932;104.236659, 30.687535;104.239112, 30.683827;104.243895, 30.680372;104.248249, 30.680452;104.251546, 30.681589;104.255095, 30.681442;104.257214, 30.683083;104.256085, 30.684585;104.254059, 30.683969;104.25392, 30.685784;104.256358, 30.687178;104.258492, 30.686608;104.259137, 30.687937;104.258859, 30.69155;104.257709, 30.692726;104.259913, 30.693465;104.261702, 30.692477;104.262206, 30.693815;104.26113, 30.694545;104.260365, 30.69546;104.25947, 30.696897;104.261488, 30.698424;104.263467, 30.699398;104.267028, 30.69985;104.270203, 30.702488;104.267454, 30.704768;104.266426, 30.706955;104.269914, 30.709189;104.27206, 30.713567;104.273358, 30.714893;104.274915, 30.716368;104.27427, 30.719544;104.277286, 30.722532;104.280243, 30.723025;104.283825, 30.720085;104.286796, 30.719572;104.290611, 30.718605;104.29466, 30.720141;104.295761, 30.722013;104.295469, 30.722748;104.299021, 30.724739;104.308617, 30.723881;104.310985, 30.722241;104.313109, 30.721158;104.318419, 30.720529;104.321311, 30.723731;104.328329, 30.723823;104.330617, 30.727712;104.332341, 30.72893;104.331758, 30.730549;104.332148, 30.734972;104.333241, 30.73919'
                ],
                isDistrict: true
              },
              {
                id: '11',
                name: '青白江区',
                lng: 104.258015,
                lat: 30.884763,
                count: 0,
                boundaries: [
                  '104.504502, 30.69338;104.500379, 30.692852;104.494906, 30.695781;104.494377, 30.690995;104.491221, 30.693007;104.487351, 30.697049;104.485427, 30.697603;104.489799, 30.702153;104.4948, 30.705596;104.497154, 30.704685;104.494869, 30.710965;104.4903, 30.714601;104.491086, 30.716724;104.484801, 30.718658;104.482178, 30.719941;104.483765, 30.722348;104.490617, 30.725517;104.485183, 30.727015;104.477486, 30.726484;104.475697, 30.729533;104.476843, 30.732772;104.479535, 30.734075;104.484349, 30.738787;104.483452, 30.744734;104.480726, 30.750787;104.481871, 30.75765;104.481623, 30.762797;104.475978, 30.766278;104.481833, 30.769055;104.480853, 30.782005;104.469605, 30.782131;104.465051, 30.780441;104.465845, 30.775225;104.462827, 30.780599;104.460957, 30.778514;104.457762, 30.777917;104.457698, 30.774083;104.45299, 30.782656;104.447003, 30.783251;104.444472, 30.781599;104.440569, 30.777721;104.4375, 30.775886;104.431796, 30.779543;104.435518, 30.785726;104.435944, 30.7912;104.440404, 30.791403;104.441765, 30.793513;104.438387, 30.797994;104.436371, 30.798353;104.435569, 30.796894;104.434786, 30.794571;104.42905, 30.793278;104.425704, 30.795179;104.422408, 30.792807;104.419201, 30.789602;104.415571, 30.788953;104.409252, 30.788582;104.40308, 30.788696;104.395192, 30.790333;104.389925, 30.791253;104.386106, 30.789831;104.386331, 30.791851;104.383568, 30.792483;104.383123, 30.797017;104.390552, 30.79778;104.39057, 30.80108;104.388894, 30.80236;104.390653, 30.807642;104.384807, 30.809617;104.38387, 30.81584;104.380229, 30.81617;104.378699, 30.816265;104.37855, 30.819236;104.37578, 30.820005;104.378256, 30.821475;104.379359, 30.822982;104.375884, 30.827225;104.376349, 30.830235;104.379507, 30.832794;104.381375, 30.835683;104.380844, 30.8394;104.375951, 30.844583;104.362349, 30.839378;104.357391, 30.847409;104.362173, 30.850683;104.362591, 30.848335;104.368089, 30.849082;104.371543, 30.852652;104.37462, 30.852638;104.378556, 30.850904;104.384209, 30.851159;104.385321, 30.857867;104.387126, 30.863365;104.393178, 30.869649;104.391819, 30.877483;104.391299, 30.883066;104.387735, 30.886194;104.382517, 30.885727;104.381215, 30.889984;104.375924, 30.892023;104.372694, 30.887014;104.370097, 30.884556;104.368108, 30.886297;104.363478, 30.887037;104.36505, 30.891305;104.366504, 30.891313;104.364882, 30.894934;104.362807, 30.894894;104.359957, 30.898408;104.361021, 30.900037;104.357819, 30.901979;104.360174, 30.904261;104.361195, 30.90654;104.359291, 30.907059;104.357593, 30.907194;104.356936, 30.909358;104.352842, 30.910788;104.35298, 30.907822;104.351241, 30.906791;104.348665, 30.905302;104.344882, 30.903785;104.339692, 30.906627;104.336814, 30.903362;104.334938, 30.900371;104.327561, 30.896807;104.318697, 30.901769;104.319486, 30.90283;104.315489, 30.904316;104.313317, 30.902819;104.309188, 30.905058;104.303788, 30.906695;104.297861, 30.909356;104.292001, 30.907996;104.291853, 30.906926;104.285459, 30.906759;104.278026, 30.908307;104.271208, 30.905302;104.2697, 30.908852;104.264242, 30.912582;104.26405, 30.909678;104.263128, 30.907858;104.259839, 30.907042;104.254589, 30.903646;104.250934, 30.903673;104.243846, 30.903342;104.238439, 30.904125;104.23893, 30.901198;104.234984, 30.901988;104.229397, 30.906783;104.224863, 30.903618;104.219552, 30.910619;104.21366, 30.910446;104.213095, 30.915489;104.203331, 30.918832;104.195013, 30.914088;104.191815, 30.908677;104.19197, 30.905901;104.190939, 30.904406;104.185472, 30.895951;104.181333, 30.893734;104.175715, 30.891976;104.177385, 30.887958;104.179502, 30.884183;104.177048, 30.881935;104.174329, 30.876932;104.166909, 30.877352;104.165508, 30.875583;104.168079, 30.874946;104.171784, 30.871134;104.172352, 30.86967;104.173029, 30.867508;104.171878, 30.866251;104.172334, 30.864744;104.173488, 30.863703;104.174466, 30.861795;104.176229, 30.862245;104.177946, 30.864591;104.180183, 30.866693;104.181805, 30.867561;104.185963, 30.871263;104.190838, 30.870149;104.19536, 30.869098;104.203863, 30.863284;104.207866, 30.867939;104.211795, 30.868451;104.213641, 30.870655;104.214558, 30.871998;104.21785, 30.867964;104.218046, 30.864842;104.221333, 30.86778;104.224438, 30.871446;104.228666, 30.868323;104.235042, 30.865378;104.238041, 30.865272;104.239206, 30.863188;104.245128, 30.861072;104.24398, 30.857087;104.246737, 30.856844;104.248848, 30.853759;104.24468, 30.848163;104.247593, 30.846978;104.246683, 30.844615;104.249446, 30.844936;104.254423, 30.84239;104.251897, 30.841526;104.250303, 30.839606;104.253933, 30.83866;104.253636, 30.834863;104.24854, 30.836688;104.238408, 30.829268;104.239997, 30.82288;104.243639, 30.821325;104.244948, 30.820433;104.245472, 30.818391;104.248605, 30.815849;104.246912, 30.810707;104.249391, 30.808863;104.255972, 30.810543;104.25926, 30.808351;104.258001, 30.803762;104.262107, 30.799774;104.265149, 30.799109;104.262285, 30.793716;104.265834, 30.791061;104.266268, 30.785863;104.268484, 30.782275;104.270757, 30.779503;104.277744, 30.775999;104.276911, 30.772742;104.273502, 30.767481;104.270674, 30.76212;104.266478, 30.761904;104.265234, 30.760723;104.265937, 30.756433;104.273405, 30.752337;104.274688, 30.748937;104.282646, 30.746832;104.284645, 30.747247;104.286217, 30.746568;104.285408, 30.744718;104.286306, 30.743022;104.291251, 30.743151;104.293274, 30.744948;104.292871, 30.746437;104.294049, 30.749411;104.295641, 30.750528;104.296828, 30.750966;104.301353, 30.749343;104.304274, 30.750857;104.306165, 30.75287;104.307571, 30.751746;104.313052, 30.749094;104.319133, 30.753402;104.320407, 30.753111;104.323587, 30.75422;104.324483, 30.756554;104.325994, 30.75357;104.326248, 30.75055;104.330852, 30.743768;104.332222, 30.741029;104.333241, 30.73919;104.332148, 30.734972;104.331758, 30.730549;104.332341, 30.72893;104.330617, 30.727712;104.328329, 30.723823;104.329893, 30.720922;104.329953, 30.718946;104.334656, 30.717146;104.338031, 30.715399;104.339225, 30.713398;104.340809, 30.712592;104.342345, 30.716611;104.341708, 30.718986;104.344916, 30.719169;104.345317, 30.718505;104.345483, 30.718294;104.345395, 30.717964;104.345987, 30.7175;104.34671, 30.717022;104.347522, 30.715466;104.347924, 30.715535;104.348236, 30.715497;104.34854, 30.714958;104.349066, 30.71479;104.348319, 30.713642;104.348271, 30.71334;104.349601, 30.711712;104.352289, 30.709866;104.353459, 30.709842;104.359527, 30.704405;104.361948, 30.704369;104.368464, 30.70227;104.369611, 30.702806;104.370479, 30.702466;104.371417, 30.700756;104.373345, 30.702967;104.37563, 30.703617;104.377801, 30.703142;104.379861, 30.703271;104.381303, 30.70299;104.383946, 30.702081;104.391039, 30.701088;104.396738, 30.699237;104.396699, 30.691393;104.395653, 30.690692;104.395809, 30.686658;104.396519, 30.683551;104.397222, 30.682739;104.400251, 30.68096;104.401782, 30.680985;104.406741, 30.676879;104.410226, 30.675913;104.41126, 30.675662;104.412125, 30.678068;104.417739, 30.681032;104.417801, 30.683766;104.419465, 30.685499;104.422706, 30.687332;104.425866, 30.687702;104.428941, 30.684033;104.430347, 30.684193;104.432068, 30.682795;104.435722, 30.679063;104.437212, 30.679568;104.439903, 30.67901;104.442672, 30.677297;104.442575, 30.672603;104.443782, 30.668156;104.447041, 30.673152;104.454505, 30.668022;104.454786, 30.664998;104.456425, 30.661877;104.463023, 30.661231;104.461858, 30.667422;104.453078, 30.677061;104.458803, 30.67494;104.460107, 30.676337;104.467392, 30.673925;104.46682, 30.67173;104.477421, 30.667665;104.492312, 30.669311;104.487628, 30.672898;104.485433, 30.674693;104.48424, 30.670955;104.478436, 30.675571;104.484125, 30.676158;104.488333, 30.679105;104.494424, 30.684247;104.501608, 30.687874'
                ],
                isDistrict: true
              }
            ]
            break
          case '1':
            break
          case '2':
            break
          case '3':
            break
          case '4':
            break
          case '5':
            break
          case '6':
            break
          case '7':
            break
          case '8':
            data = [
              {
                id: '222',
                name: '成都南玻玻璃有限公司',
                lng: 104.004798,
                lat: 30.503296,
                count: 4,
                isDistrict: false
              }
            ]
            break
          case '9':
            break
          case '10':
            data = [
              {
                id: '111',
                name: '成都市新都金海污水处理有限责任公司',
                lng: 104.189311,
                lat: 30.805882,
                count: 4,
                isDistrict: false
              }
            ]
            break
          case '11':
            break
        }
        this.districtClusterer(data)
        this.mapLoading = false
      }, 500)
    },
    // 行政区聚合点
    districtClusterer (data) {
      this.map.clearOverlays()
      const pointArray = []
      data.forEach(el => {
        const point = new BMapGL.Point(el.lng, el.lat)
        if (el.isDistrict) { // 行政区
          this.labelData = []
          const label = new BMapGL.Label(
            `<div class="map-district-label">
              <p>${el.name}</p>
              <p>${el.count}家</p>
            </div>`,
            {
              position: point,
              offset: new BMapGL.Size(-35, -35)
            }
          )
          label.setStyle({
            width: '70px',
            height: '70px',
            border: '0',
            background: 'rgba(24, 144, 255,.9)',
            borderRadius: '50%',
            cursor: 'pointer'
          })
          // 鼠标移入显示行政区边界
          label.addEventListener('mouseover', () => {
            label.setStyle({
              background: 'rgba(67, 165, 255,.9)'
            })
            this.getBoundary(el.boundaries)
          })
          // 鼠标移出隐藏行政区边界
          label.addEventListener('mouseout', () => {
            label.setStyle({
              background: 'rgba(24, 144, 255,.9)'
            })
            this.districtOverlay.forEach(el => {
              el.setPath([])
              this.map.removeOverlay(el)
            })
          })
          // 点击行政区显示详情
          label.addEventListener('click', () => {
            if (el.count > 0) {
              this.noZoomend = true
              this.getData(el.id)
            }
          })
          this.map.addOverlay(label)
        } else { // 非行政区
          const label = new BMapGL.Label(
            `<p class="map-enterprise-label">
              <i>${el.count}台</i>
              <span>${el.name}</span>
            </p>`,
            {
              position: point,
              offset: new BMapGL.Size(0, -69)
            }
          )
          label.setStyle({
            height: '30px',
            background: 'none',
            border: '0'
          })
          // 点击行政区显示详情
          label.addEventListener('click', () => {
            this.$router.push({ name: 'equipmentMonitoring', params: { id: el.id } })
          })
          this.labelData.push(label)
          this.map.addOverlay(label)
          pointArray.push(point)
        }
      })
      if (this.noZoomend) {
        this.map.setViewport(pointArray, {
          margins: [100, 360, 100, 360]
        })
      }
    },
    // 获取行政区边界并绘制
    getBoundary (boundaries) {
      boundaries.forEach(el => {
        const ply = new BMapGL.Polygon(el, {
          strokeWeight: 2,
          strokeColor: '#1890ff',
          fillColor: '#f1f1f1'
        })
        this.map.addOverlay(ply)
        this.districtOverlay.push(ply)
        ply.enableMassClear()
      })
    },
    // 动态加载数据点
    addViewLabel (labels) {
      // this.map.clearOverlays()
      // for (var i = 0; i < labels.length; i++) {
      //   // eslint-disable-next-line no-undef
      //   const result = BMapLib.GeoUtils.isPointInRect(labels[i].point, this.map.getBounds())
      //   if (result) {
      //     this.map.addOverlay(labels[i])
      //   } else {
      //     this.map.removeOverlay(labels[i])
      //   }
      // }
    }
  }
}
</script>
<style lang="scss">
.data-monitor-map-container {
  height: 100%;
  z-index: 1;
  position: relative;
}
.data-monitor-map-loading {
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(255, 255, 255, 0.5);
  width: 100%;
  height: 100%;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: center;
  .ant-spin-text {
    font-size: 18px;
  }
}
.data-monitor-map {
  height: 100%;
  width: 100%;
  overflow: hidden;
  margin: 0;
  position: absolute;
  top: 0;
  left: 0;
}
.map-district-label {
  font-size: 14px;
  display: flex;
  align-content: center;
  flex-wrap: wrap;
  height: 100%;
  width: 100%;
  p {
    text-align: center;
    color: #ffffff;
    width: 100%;
    margin: 2px 0;
  }
}
.map-enterprise-label {
  position: relative;
  color: #ffffff;
  line-height: 30px;
  transform: translateX(-50%);
  background-color: #1890ff;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  border: 1px solid #1890ff;
  &::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    position: absolute;
    top: 29px;
    left: 50%;
    margin-left: -9px;
    border-top: 9px solid #1890ff;
    border-left: 9px dashed transparent;
    border-right: 9px dashed transparent;
  }
  i {
    font-style: normal;
    background-color: #ffffff;
    padding: 0 10px;
    color: #1890ff;
    border-radius: 4px 0 0 4px;
  }
  span {
    padding: 0 10px;
  }
  b {
    position: absolute;
    bottom: -35px;
    left: 50%;
    margin-left: -10px;
    width: 20px;
    height: 20px;
    border-radius: 100%;
    background-color: red;
  }
}
</style>
